package com.codinghero.sae;

import java.util.Map;

import com.sina.sae.fetchurl.SaeFetchurl;

public class SaeHttpUtils {
	public static String postBasicAuth(String protocol, String hostName,
			int port, String uri, String userName, String password, Map<String, String> parameters) {
		SaeFetchurl fetchUrl = new SaeFetchurl();
		fetchUrl.setMethod("post");
		fetchUrl.setPostData(parameters);
		fetchUrl.setHttpAuth(userName, password);
		String url = protocol + "://" + hostName + ":" + port + uri;
		String content = fetchUrl.fetch(url);
		return content;
	}
}
